import Vue from 'vue';
import VueRouter from 'vue-router';

import Login from '../pages/Login';
import Admin from '../pages/Admin';
import Classes from '../pages/Classes';
import Product from '../pages/Product';
import Home from '../pages/Home';

Vue.use(VueRouter);
const router = new VueRouter({
    routes: [
        { path: '/login', component: Login },
        {
            path: '/admin', component: Admin,
            children: [
                { path: 'classes', component: Classes },
                { path: 'product', component: Product },
                { path: 'home', component: Home },
                { path: '/', redirect: 'home' }
            ]
        },
        { path: '/', redirect: '/login' }
    ]
});

export default router;